package com.assess.web.util;

/**
 * Created by guoqi.
 */
public class RespCode {

    public static enum Common implements EnumRespCode {

        SUCCESS("00000", "成功"),
        SYSERROR("00001", "服务端异常"),
        PARAMCHECKERROR("00002", "参数校验错误"),
        VERCODEEXPIRE("00003", "验证码过期"),
        APPVERSIONLOW("00004", "app版本过低"),
        COMMENTED_FAIL("00005", "请输入评价");

        private static final String MODULE = "";
        private String code;
        private String desc;

        Common(String code, String desc) {
            this.code = Common.MODULE + code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }

    public static enum UserModule implements EnumRespCode {

        NEEDLOGIN("00000", "用户未登录"),
        PHONENOTREG("00001", "手机号未注册"),
        PASSWORDERROR("00002", "密码不正确"),
        PHONEEXIST("00003", "手机号已存在");

        private static final String MODULE = "00001-";
        private String code;
        private String desc;

        UserModule(String code, String desc) {
            this.code = UserModule.MODULE + code;
            this.desc = desc;
        }

        public String getCode() {
            return code;
        }

        public String getDesc() {
            return desc;
        }
    }

    public static interface EnumRespCode {

        String getCode();

        String getDesc();
    }

}
